package com.example.demo;

import com.example.demo.producer.ProduceTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author Song Yinghui
 * @date 2019/12/6
 * @Version 1.0
 */
@Component
@EnableScheduling
public class ScheduledTest {

    @Autowired
    private ProduceTest produceTest;

    //@Scheduled(cron = "* * * * * *")
    public void test(){
        produceTest.send();
    }

    @Scheduled(cron = "* * * * * *")
    public void sendQueueTest(){
        produceTest.sendQueue();
    }

    @Scheduled(cron = "* * * * * *")
    public void sendQueue1Test(){
        produceTest.sendQueue1();
    }
}
